<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>幼儿园收费管理系统 - {% block title %}{% endblock %}</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css" rel="stylesheet">
    <style>
        .navbar-nav .nav-link {
            color: rgba(255,255,255,.8) !important;
        }
        .navbar-nav .nav-link:hover {
            color: #fff !important;
        }
        .dropdown-menu {
            margin-top: 0;
        }
        .dropdown:hover .dropdown-menu {
            display: block;
        }
    </style>
    {% block styles %}{% endblock %}
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
        <div class="container">
            <a class="navbar-brand" href="{{ url_for('index') }}">幼儿园收费管理系统</a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav">
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('list_classes') }}">开设班级</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('list_registrations') }}">招收学生</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('list_payments') }}">收费管理</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('payment_summary') }}">收费统计</a>
                    </li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown">
                            基础设置
                        </a>
                        <ul class="dropdown-menu">
                            <li><a class="dropdown-item" href="{{ url_for('list_parents') }}">家长管理</a></li>
                            <li><a class="dropdown-item" href="{{ url_for('list_students') }}">学生管理</a></li>
                            <li><a class="dropdown-item" href="{{ url_for('list_grades') }}">年级管理</a></li>
                            <li><a class="dropdown-item" href="{{ url_for('list_semesters') }}">学期管理</a></li>
                            <li><a class="dropdown-item" href="{{ url_for('list_accounts') }}">收款账号</a></li>
                            <li><a class="dropdown-item" href="{{ url_for('list_projects') }}">收费项目</a></li>
                            <li><hr class="dropdown-divider"></li>
                            <li><a class="dropdown-item" href="{{ url_for('import_page') }}">导入数据</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <div class="container mt-4">
        {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
                {% for category, message in messages %}
                    <div class="alert alert-{{ 'danger' if category == 'error' else 'success' }}">
                        {{ message }}
                    </div>
                {% endfor %}
            {% endif %}
        {% endwith %}
        {% block content %}{% endblock %}
    </div>

    <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
    {% block scripts %}{% endblock %}
</body>
</html>